package tool

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
)

func SendGetRQ(url string) []byte {
	resp, err := http.Get(url)
	if err != nil {
		fmt.Print(err)
	}
	closer := resp.Body
	bytes, err := ioutil.ReadAll(closer)
	return bytes
}
func SendGetRQWithCookie(url string, cookie string) []byte {
	payload := strings.NewReader("")
	req, err := http.NewRequest("GET", url, payload)
	req.Header.Add("Cookie", cookie)
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	if err != nil {
		fmt.Print("err", err)
	}
	closer := resp.Body
	bytes, err := ioutil.ReadAll(closer)
	return bytes
}
